TESTING = {}



function TESTING.TESTFUNCTION5()
	natives.AI.TASK_START_SCENARIO_IN_PLACE(plyPed, "WORLD_HUMAN_SMOKING", -1, true)
end



function TESTING.TESTFUNCTION1()
	for k,v in pairs(NEWANIMDICTLIST) do
		natives.STREAMING.REQUEST_ANIM_DICT(NEWANIMDICTLIST[k])
	end
end


function TESTING.TESTFUNCTION2()
	Z = AnimResearchNumb+1
	if (Z > #NEWANIMDICTLIST) then Z = 1 end
	AnimResearchNumb = Z
	natives.STREAMING.REQUEST_ANIM_DICT(NEWANIMDICTLIST[Z])
	if natives.STREAMING.HAS_ANIM_DICT_LOADED(NEWANIMDICTLIST[Z]) == true then		
		natives.AI.TASK_PLAY_ANIM(plyPed, NEWANIMDICTLIST[Z], NEWANIMLIST[Z], 8, -8, -1, 0, 0, false, false, true)
	end
end

function TESTING.TESTFUNCTION3()
	Z = AnimResearchNumb-1
	if (Z < 1) then Z = 1 end
	AnimResearchNumb = Z
	natives.STREAMING.REQUEST_ANIM_DICT(NEWANIMDICTLIST[Z])
	if natives.STREAMING.HAS_ANIM_DICT_LOADED(NEWANIMDICTLIST[Z]) == true then		
		natives.AI.TASK_PLAY_ANIM(plyPed, NEWANIMDICTLIST[Z], NEWANIMLIST[Z], 8, -8, -1, 0, 0, false, false, true)
	end
end

function TESTING.TESTFUNCTION4()
	if TESTING.readFile("GTALua/addons/AnimatedActions/SavedAnims.txt") == nil then 
		print("ERROR: NO FILE FOUND!")
		TESTING.writeFile("GTALua/addons/AnimatedActions/SavedAnims.txt", "")
		print("INFO: NEW FILE HAS BEEN CREATED!")
	end
	TESTING.writeFile("GTALua/addons/AnimatedActions/SavedAnims.txt",("\n"))
	TESTING.writeFile("GTALua/addons/AnimatedActions/SavedAnims.txt", NEWANIMDICTLIST[Z].." = ")
	TESTING.writeFile("GTALua/addons/AnimatedActions/SavedAnims.txt", NEWANIMLIST[Z])
	TESTING.writeFile("GTALua/addons/AnimatedActions/SavedAnims.txt",("\n"))
	print("INFO: ANIMATION SAVED SUCCESFULLY!")
end

function TESTING.readFile(file)
	local file = io.open(file, "r" )
	if file then
		-- read all contents of file into a string
		local contents = file:read("*a")
		io.close(file)
		return contents
	end
end
 
function TESTING.writeFile(file, contents)
	local file = io.open(file, "a+")
	if file then
		file:write(contents)
		io.close(file)
	end
end

-- TESTING tick
function TESTING.tick()

end




-- TESTING init
function TESTING.init()

end

-- TESTING Onerror 
function TESTING:OnError()
	--self:Kill()
	--addon.Load("RENAMEME")
end